﻿using BuildDatabase.Repository;
using Ducu.BLL.Entity;
using Ducu.GLB.Story;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BuildDatabase.Factory
{
    internal static class KeywordFactory
    {
        internal static void Create()
        {
            KeywordRepository.VOA = create(Keywords.VOA);
            KeywordRepository.VOA.Plans = new List<Plan>
            {
                PlanRepository.Yezi_VOA
            };

            KeywordRepository.English = create(Keywords.English);
            KeywordRepository.English.Plans = new List<Plan>
            {
                PlanRepository.Yezi_VOA
            };

            KeywordRepository.CATTI = create(Keywords.CATTI);
            KeywordRepository.CATTI.Plans = new List<Plan>
            {
                PlanRepository.Abu_Exam
            };
        }

        private static Keyword create(Keyword keyword)
        {
            NHProvider.session.Save(keyword);
            return keyword;
        }
    }
}
